/*
 * ODO: Real-Time In-Memory ORM/DBMS Grid software
 * Copyright (c) 2008, Michael Oksenenko
 * All rights reserved.
 */
#ifndef SYSLOG_INSTALLER_FACTORY_HPP
#define SYSLOG_INSTALLER_FACTORY_HPP

#include "OsConfig.hpp"

#include "OsComponentFactoryIF.hpp"
#include "SyslogInstallerIF.hpp"
#include "SyslogInstallerLinux.hpp"
#include "SyslogInstallerVista.hpp"

#include <memory>

namespace odo {

template<unsigned OS>
class SyslogInstallerFactory : public OsComponentFactoryIF<SyslogInstallerIF> {

public: // iface

	virtual std::auto_ptr<SyslogInstallerIF> getComponent() = 0;

public: // factory

	virtual ~SyslogInstallerFactory() { /* void */ }

};

//============================================================================
#if ODO_OS_LINUX == ODO_CHOSEN_OS
//----------------------------------------------------------------------------
template<>
class SyslogInstallerFactory<ODO_OS_LINUX> : public OsComponentFactoryIF<SyslogInstallerIF> {

public: // iface

	virtual std::auto_ptr<SyslogInstallerIF> getComponent() {
		return std::auto_ptr<SyslogInstallerIF>(new SyslogInstallerLinux());
	}

public: // factory

	virtual ~SyslogInstallerFactory() { /* void */ }
	SyslogInstallerFactory() { /* void */ }

};
//----------------------------------------------------------------------------
#endif /* ODO_OS_LINUX */
//============================================================================
#if ODO_OS_VISTA == ODO_CHOSEN_OS
//----------------------------------------------------------------------------
template<>
class SyslogInstallerFactory<ODO_OS_VISTA> : public OsComponentFactoryIF<SyslogInstallerIF> {

public: // iface

	virtual std::auto_ptr<SyslogInstallerIF> getComponent() {
		return std::auto_ptr<SyslogInstallerIF>(new SyslogInstallerVista());
	}

public: // factory

	virtual ~SyslogInstallerFactory() { /* void */ }
	SyslogInstallerFactory() { /* void */ }

};
//----------------------------------------------------------------------------
#endif /* ODO_OS_VISTA */
//============================================================================

}

#endif /* SYSLOG_INSTALLER_FACTORY_HPP */
